package com.qf.agro.web.controller.warning;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.qf.agro.common.sys.ResultInfo;
import com.qf.agro.pojo.warning.EarlyWarning;
import com.qf.agro.service.warning.EarlyWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/warning/warning")
public class EarlyWarningController {
    @Autowired
    private EarlyWarningService earlyWarningService;

    @GetMapping("/page")
    public ResultInfo findPage(@RequestParam(value = "page", defaultValue = "1") Integer pageNum,
                               @RequestParam(defaultValue = "5") Integer pageSize,
                               String name,
                               Long facilitiesId) {
        Page<EarlyWarning> page = earlyWarningService.findPage(pageNum, pageSize, name, facilitiesId);
        return ResultInfo.success(page);
    }
}
